package jtable;

import javax.swing.*;   

import java.awt.*;   
import java.awt.event.*;   
public class JTableTester extends JFrame{   
    //private Test t;   
    private JButton btn;   
    private JFrame temp;
    public JTableTester() {   
        super("Testing JTable in JTabbedThingy");
        this.setBackground(new Color(225,240,255));
        
        Container c = getContentPane();
        c.setBackground(new Color(225,240,255));
        c.setLayout(new BorderLayout());   
    //adding tabbedpane to application level frame.   
        JTabbedPane pane = new JTabbedPane();
        pane.setBackground(new Color(225,240,255));
        c.add(pane, BorderLayout.CENTER);   
    //add first tab   
        JPanel firstTab = new JPanel();   
        firstTab.setLayout(new BorderLayout());   
        JTable table = new JTable(100,10);
        table.setBackground(new Color(225,240,255));
        JScrollPane scrollPane = new JScrollPane(table);
        scrollPane.setBackground(new Color(225,240,255));
        firstTab.add(scrollPane, BorderLayout.CENTER);   
        pane.addTab("Table Tab", firstTab);   
    //add second tab   
        JPanel secondTab = new JPanel();
        secondTab.setBackground(new Color(225,240,255));
        secondTab.setLayout(new FlowLayout());   
        secondTab.add(new JTextField("hello world"));   
        pane.addTab("A second tab", secondTab);   
  
        setSize(850,450);   
        setVisible(true);   
    }   
    public static void main(String args[]) {   
        JTableTester app = new JTableTester();   
        app.addWindowListener(new WindowAdapter() {   
            public void windowClosing(WindowEvent e) {   
                System.exit(0);   
            }   
        });   
    }   
  
}  
